package technology.java;

import java.nio.charset.Charset;
import java.util.stream.IntStream;

public class javaUnicode {
    public static void main(String[] args) {
        // 在IDEA的配置设了编码是utf-8 , 如果是记事本的话，下面2个都输出GBK
        //获取系统默认编码 UTF-8
        System.out.println("系统默认编码：" + System.getProperty("file.encoding"));
        //系统默认字符编码  UTF-8
        System.out.println("系统默认字符编码:" + Charset.defaultCharset());
        //操作系统用户使用的语言 zh
        System.out.println("系统默认语言:" + System.getProperty("user.language"));
        System.out.println("===================================");
        tsChar();
        tsUni1();

    }
    private static void tsUni1(){
        String aa = "abc";
        IntStream intStream = aa.codePoints();
        System.out.println(intStream);
        System.out.println(aa.codePointAt(0));

    }


    private static void tsChar(){
        char c1 = '?';
        String c2 = "𠀃";
        String tt = "𠀃这个字符";
        System.out.println(tt.length()); // 9
        System.out.println(c2.length()); // 9
        System.out.println("=================");
//        System.out.println(c1);
        StringBuffer sb = new StringBuffer();
        sb.append(Character.toChars(127850));
        System.out.println(sb); // 输出 🍪 表情  852是🍬

    }

}
